package cmd

import (
	"github.com/spf13/cobra"
)

var RootCmd = &cobra.Command{
	Use: "service_addr_syncer",
}

func init() {
	RootCmd.AddCommand(StartCmd)
	RootCmd.AddCommand(VersionCmd)

	StartCmd.PersistentFlags().StringSliceVar(&etcdEndpoints, "etcd_endpoints", []string{"192.168.69.6:22379"}, "etcd 集群的地址")
	StartCmd.PersistentFlags().StringSliceVar(&syncEtcdEndpoints, "sync_etcd_endpoints", []string{"127.0.0.1:2379"}, "同步数据的etcd 集群的地址")
	StartCmd.PersistentFlags().StringVar(&doveEnv, "dove_env", "devcd", "dove 环境")
	StartCmd.PersistentFlags().StringVar(&logFile, "log", "/home/logs/service_addr_syncer/service_addr_syncer.log", "日志路径")
	StartCmd.PersistentFlags().IntVar(&syncDelDelay, "sync_del_delay", 60, "同步删除操作时的延时秒数")

	VersionCmd.PersistentFlags().BoolVarP(&showVersiondetail, "all", "a", false, "输出详细版本信息")
}
